{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>厚浦博客</title>
    <link href="{% static 'bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/cl-css.css' %}" rel="stylesheet">
    <link href="{% static 'font-awesome/css/font-awesome.min.css' %}" rel="stylesheet">
    <link rel="stylesheet" href="{% static 'highlight/styles/railscasts.css' %}">
</head>
<body>
<div id="app">
    <div class="cl-header container-fluid">
        <div class="header-content container">
            <nav class="navbar navbar-expand-lg navbar-light">
                <a class="navbar-brand" href="/">
                    <img src="{% static 'img/oo.jpeg' %}" width="144" height="72" alt="">
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
                        aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse justify-content-end" id="navbarNav">
                    <ul class="navbar-nav">
                        <li class="nav-item active">
                            <a class="nav-link" href="{% url 'home:index' %}">首页 <span class="sr-only">(current)</span></a>
                        </li>
                        <li class="nav-item">
                        <!-- 如果用户已经登录，则显示用户名下拉框 -->
                            <li class="nav-item dropdown" v-if="is_login">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="show_menu_click">{{ username }}</a>
                                <div class="dropdown-menu" aria-labelledby="navbarDropdown" style="display: block" v-show="show_menu">
                                    <a class="dropdown-item" href="{% url 'home:write' %}">写文章</a>
                                    <a class="dropdown-item" href='{% url 'users:zhong' %}'>个人信息</a>
                                    <a class="dropdown-item" href='{% url 'users:logout' %}'>退出登录</a>
                                </div>

                            <!-- 如果用户未登录，则显示登录按钮 -->
                            <li class="nav-item" v-else>
                                <a class="nav-link" href="{% url 'users:login' %}">登录</a>

                            </li>
                    </ul>
                </div>
            </nav>


        </div>

    </div>
</div>
 <form class="col-md-10 offset-md-1" method="post" enctype="multipart/form-data">
 {% csrf_token %}
    <div class="form-group">
        <label for="avatar">上传头像</label>
       <input type="file" class="form-control-file" name="avatar" id="avatar">
    </div>
    <div class="form-group">
        <label for="title">文章标题</label>
        <input type="text" class="form-control" id="title" name="title" value="{{ mobile }}">
    </div>
    <div class="form-group">
            <label for="category">栏目</label>
            <select name="category" id="category" class="form-control">
                {% for f in a %}
                    <option value="{{ f.id }}">{{ f.title }}</option>
                {% endfor %}

            </select>
        </div>
    <div class="form-group">
        <label for="tags">标签</label>
        <input type="text" class="form-control" id="tags" name="tags" value="{{ mobile }}">
    </div>
    <div class="form-group">
        <label for="sumary">文章摘要</label>
        <input type="text" class="form-control" id="sumary" name="sumary" value="{{ mobile }}">
    </div>

    <div class="form-group">
        <textarea id="editor1" name="content" rows="10" cols="80">

        </textarea>
    </div>

    <script type="text/javascript">
        function getTxt() {
            var data = CKEDITOR.instances.editor1.getData();
            alert(data)
        }
    </script>

    <script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
    <script>
        CKEDITOR.replace( 'editor1' );
    </script>
    <div class="form-group">
        <button type="submit" class="btn btn-primary btn-block">提交</button>
    </div>
</form>



<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<script src="{% static 'jquery/jquery.min.js' %}"></script>
<script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<script src="{% static 'highlight/highlight.pack.js' %}"></script>
<script src="{% static 'vue/vue-2.5.16.js' %}"></script>
<script src="{% static 'js/host.js' %}"></script>
<script src="{% static 'vue/axios-0.18.0.min.js' %}"></script>
<script src="{% static 'js/common.js' %}"></script>
<script src="{% static 'js/index.js' %}"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
